package com.yh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yh.bean.Message;
import com.yh.dao.MessDao;
import com.yh.service.MessService;


@Service("messServiceImpl")
public class MessServiceImpl implements MessService {
	
	//注入dao层
	@Autowired
	private MessDao messDao;
	
	/*
	 * 查询通知实现
	 */
	@Override
	public List<Message> queryMessage() {
		// TODO Auto-generated method stub
		List<Message> mlist=messDao.queryMessage();
		System.out.println("querymessimpl输出测试："+mlist);
		return mlist;
	}
	
	/*
	 * 通过Id查找具体通告信息实现
	 */
	@Override
	public Message showMessage(int id) {
		// TODO Auto-generated method stub
		Message mlist=messDao.showMessage(id);
		System.out.println("showmessimpl输出展示"+mlist);
		return mlist;
	}
	
	/*
	 * 删除通告信息
	 */
	@Override
	public int deleteMessage(int meid) {
		// TODO Auto-generated method stub
		int a=messDao.deleteMessage(meid);
		System.out.println(a);
		return a;
	}
	
	/*
	 * 添加通告信息
	 */
	@Override
	public int insertMessage(Message mess) {
		// TODO Auto-generated method stub
		System.out.println("添加impl层"+mess);
		int a =messDao.insertMessage(mess);
		System.out.println("添加impl返回"+a);
		return a;
	}
	
	
}
